<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"><title>Ahuang'Blog - [object Object]</title><meta name="author" content="Ahuang"><meta name="copyright" content="Ahuang"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="Everything can be expected in the future">
<meta property="og:type" content="website">
<meta property="og:title" content="Ahuang&#39;Blog">
<meta property="og:url" content="http://huangxiaochang.gitee.io/ahuang_blog/page/4/index.html">
<meta property="og:site_name" content="Ahuang&#39;Blog">
<meta property="og:description" content="Everything can be expected in the future">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="http://huangxiaochang.gitee.io/ahuang_blog/img/Misaka.jpg">
<meta property="article:author" content="Ahuang">
<meta property="article:tag" content="博客">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="http://huangxiaochang.gitee.io/ahuang_blog/img/Misaka.jpg"><link rel="shortcut icon" href="/ahuang_blog/img/favicon.ico"><link rel="canonical" href="http://huangxiaochang.gitee.io/ahuang_blog/page/4/index.html"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><meta/><link rel="stylesheet" href="/ahuang_blog/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/ahuang_blog/',
  algolia: undefined,
  localSearch: {"path":"/ahuang_blog/search.xml","preload":true,"languages":{"hits_empty":"找不到您查询的内容：${query}"}},
  translate: undefined,
  noticeOutdate: {"limitDay":500,"position":"top","messagePrev":"It has been","messageNext":"days since the last update, the content of the article may be outdated."},
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":400},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isAnchor: false,
  percent: {
    toc: true,
    rightside: true,
  }
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: 'Ahuang\'Blog',
  isPost: false,
  isHome: true,
  isHighlightShrink: false,
  isToc: false,
  postUpdate: '2023-02-21 15:20:12'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
    win.getCSS = url => new Promise((resolve, reject) => {
      const link = document.createElement('link')
      link.rel = 'stylesheet'
      link.href = url
      link.onload = () => resolve()
      link.onerror = () => reject()
      document.head.appendChild(link)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><link rel="stylesheet" href="/blog/css/transpancy.css"><link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/js-heo@1.0.11/mainColor/heoMainColor.css"><link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/js-heo@1.0.11/categoryBar/categoryBar.css"><!-- hexo injector head_end start --><link rel="stylesheet" href="https://npm.elemecdn.com/hexo-butterfly-clock/lib/clock.min.css" /><!-- hexo injector head_end end --><meta name="generator" content="Hexo 6.3.0"></head><body><div id="loading-box"><div class="loading-left-bg"></div><div class="loading-right-bg"></div><div class="spinner-box"><div class="configure-border-1"><div class="configure-core"></div></div><div class="configure-border-2"><div class="configure-core"></div></div><div class="loading-word">加载中...</div></div></div><script>const preloader = {
  endLoading: () => {
    document.body.style.overflow = 'auto';
    document.getElementById('loading-box').classList.add("loaded")
  },
  initLoading: () => {
    document.body.style.overflow = '';
    document.getElementById('loading-box').classList.remove("loaded")

  }
}
window.addEventListener('load',()=> { preloader.endLoading() })

if (false) {
  document.addEventListener('pjax:send', () => { preloader.initLoading() })
  document.addEventListener('pjax:complete', () => { preloader.endLoading() })
}</script><div id="web_bg"></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="/ahuang_blog/img/Misaka.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/ahuang_blog/archives/"><div class="headline">文章</div><div class="length-num">51</div></a><a href="/ahuang_blog/tags/"><div class="headline">标签</div><div class="length-num">35</div></a><a href="/ahuang_blog/categories/"><div class="headline">分类</div><div class="length-num">8</div></a></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/ahuang_blog/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/ahuang_blog/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/ahuang_blog/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/ahuang_blog/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/ahuang_blog/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div></div></div><div class="page" id="body-wrap"><header class="full_page fixed" id="page-header"><nav id="nav"><span id="blog-info"><a href="/ahuang_blog/" title="Ahuang'Blog"><span class="site-name">Ahuang'Blog</span></a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search" href="javascript:void(0);"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/ahuang_blog/"><i class="fa-fw fas fa-home"></i><span> 首页</span></a></div><div class="menus_item"><a class="site-page" href="/ahuang_blog/archives/"><i class="fa-fw fas fa-archive"></i><span> 时间轴</span></a></div><div class="menus_item"><a class="site-page" href="/ahuang_blog/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/ahuang_blog/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/ahuang_blog/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div><div id="toggle-menu"><a class="site-page" href="javascript:void(0);"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="site-info"><h1 id="site-title">Ahuang'Blog</h1><div id="site_social_icons"><a class="social-icon" href="https://github.com/changad" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="mailto:136081905@qq.com" target="_blank" title="Email"><i class="fas fa-envelope"></i></a></div></div><div id="scroll-down"><i class="fas fa-angle-down scroll-down-effects"></i></div></header><main class="layout" id="content-inner"><div class="recent-posts" id="recent-posts"><div class="recent-post-item"><div class="post_cover left"><a href="/ahuang_blog/2020/09/30/021/" title="php压缩成zip文件并下载"><img class="post-bg" src="https://fastly.jsdelivr.net/gh/jerryc127/CDN@latest/cover/default_bg.png" onerror="this.onerror=null;this.src='/ahuang_blog/img/404.jpg'" alt="php压缩成zip文件并下载"></a></div><div class="recent-post-info"><a class="article-title" href="/ahuang_blog/2020/09/30/021/" title="php压缩成zip文件并下载">php压缩成zip文件并下载</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-09-30T10:55:05.000Z" title="发表于 2020-09-30 18:55:05">2020-09-30</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/ahuang_blog/categories/PHP/">PHP</a></span></div><div class="content">压缩并下载业务代码
12345678910111213141516171819202122232425262728293031323334//引用工具类use zip\TraverseDir;use zip\Download;//要压缩的文件目录$cur_file = $save_path.$files_name.&#x27;/&#x27;; //先判断zip 压缩包是否存在if(!file_exists($save_path.$files_name.&#x27;.zip&#x27;))&#123;    // 打包下载    $handler = opendir($cur_file);    //$cur_file 文件所在目录    $download_file = array();    $i = 0;    while( ($filename = readdir($handler)) !== false ) &#123;        if($filename != &#x27;.&#x27; &amp;&amp; $filename != &#x27;..&#x27;) &# ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/ahuang_blog/2020/09/29/020/" title="Redis缓存之哈希数据库"><img class="post-bg" src="https://fastly.jsdelivr.net/gh/jerryc127/CDN@latest/cover/default_bg.png" onerror="this.onerror=null;this.src='/ahuang_blog/img/404.jpg'" alt="Redis缓存之哈希数据库"></a></div><div class="recent-post-info"><a class="article-title" href="/ahuang_blog/2020/09/29/020/" title="Redis缓存之哈希数据库">Redis缓存之哈希数据库</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-09-29T04:34:19.000Z" title="发表于 2020-09-29 12:34:19">2020-09-29</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/ahuang_blog/categories/Redis/">Redis</a></span></div><div class="content">书接上回这段时间公司要让在程序上发7000万个码，奈何数据库插入操作太慢，改用redis作为数据库
想把redis作为数据库，首先要修改其配置让其永久性存储
配置文件路径
1usr/redis/redis.conf

记录磁盘配配置处理
12345appendonly： yes     默认情况下AOF功能是关闭的，将该选项改为yes以便打开Redis的AOF功能。appendfsync: everysec     设置三个值，分别是：always 每次对redis的操作都会记录，效率最低everysec 每秒对redis的操作记录到磁盘no 大约每30秒对redis的操作记录到磁盘

配置处理：
123456# 周期性执行条件的设置格式为save &lt;seconds&gt; &lt;changes&gt;# 默认的设置为：save 900 1save 300 10save 60 10000 

以上分别表示更改了1个key时间隔900s进行持久化存储；更改了10个key300s进行存储；更改10000个key60s进行存储。
存入
1234//参数一：表名 //参数二：键 //参 ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/ahuang_blog/2020/09/28/019/" title="Redis缓存之列队"><img class="post-bg" src="https://fastly.jsdelivr.net/gh/jerryc127/CDN@latest/cover/default_bg.png" onerror="this.onerror=null;this.src='/ahuang_blog/img/404.jpg'" alt="Redis缓存之列队"></a></div><div class="recent-post-info"><a class="article-title" href="/ahuang_blog/2020/09/28/019/" title="Redis缓存之列队">Redis缓存之列队</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-09-28T10:55:49.000Z" title="发表于 2020-09-28 18:55:49">2020-09-28</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/ahuang_blog/categories/Redis/">Redis</a></span></div><div class="content">前段时间要写一个发码任务，实现一物一码追溯，为了防止数据库崩溃，使用了redis列队实现一批一批的发码
创建swoole定时任务、依次从列队中取出执行
12345678910111213/** * 1、定时任务将创建的任务加入列队中 * 2、定时任务将列队中的任务依次执行 * @type &#123;[type]&#125; */$redis = \redis\RedisPackage::getInstance();//获取队列长队$redis-&gt;Llen(&quot;QR&quot;);/*加入列队*/$redis-&gt;LPush(&quot;QR&quot;,$str);//依次读取$redis-&gt;lPop(&quot;QR&quot;);


单例模式封装的redis工具类
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/ahuang_blog/2020/07/02/017/" title="支付宝App支付"><img class="post-bg" src="https://fastly.jsdelivr.net/gh/jerryc127/CDN@latest/cover/default_bg.png" onerror="this.onerror=null;this.src='/ahuang_blog/img/404.jpg'" alt="支付宝App支付"></a></div><div class="recent-post-info"><a class="article-title" href="/ahuang_blog/2020/07/02/017/" title="支付宝App支付">支付宝App支付</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-07-02T07:14:34.000Z" title="发表于 2020-07-02 15:14:34">2020-07-02</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/ahuang_blog/categories/PHP/">PHP</a></span></div><div class="content">配置参数
12345678910//支付宝支付配置&#x27;ali&#x27; =&gt; [    //appid    &#x27;appid&#x27; =&gt; &#x27;&#x27;,    //应用私钥    &#x27;rsaPrivateKeys&#x27; =&gt; &#x27;&#x27;,    //应用公钥    &#x27;alipayrsaPublicKeys&#x27; =&gt; &#x27;&#x27;,    &#x27;notify_url&#x27; =&gt; &#x27;/api/v1/alipaynotify&#x27;,],



获取支付签名 （调用支付业务类）
1234(new \app\api\service\PayService($order_no, $user_id)) //订单号 用户id            -&gt;setMoney($money)  //商品价格            -&gt;setBody($body)  //商品名            -&gt;doPaid();

支付成功回调
123 ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/ahuang_blog/2020/07/02/016/" title="微信App支付"><img class="post-bg" src="https://fastly.jsdelivr.net/gh/jerryc127/CDN@latest/cover/default_bg.png" onerror="this.onerror=null;this.src='/ahuang_blog/img/404.jpg'" alt="微信App支付"></a></div><div class="recent-post-info"><a class="article-title" href="/ahuang_blog/2020/07/02/016/" title="微信App支付">微信App支付</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-07-02T05:29:13.000Z" title="发表于 2020-07-02 13:29:13">2020-07-02</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/ahuang_blog/categories/PHP/">PHP</a></span></div><div class="content">配置参数
1234567891011//微信支付配置&#x27;wechat&#x27; =&gt; [    &#x27;appid&#x27; 		=&gt; &#x27;&#x27;,    //商户号    &#x27;mchid&#x27;			=&gt;	&#x27;&#x27;,    //支付秘钥    &#x27;key&#x27;			=&gt;	&#x27;&#x27;,    //回调地址    &#x27;notify_url&#x27;	=&gt;	&quot;/api/v1/wechatpaynotify&quot;,],




获取支付签名 （调用支付业务类）
1234(new \app\api\service\PayService($order_no, $user_id)) //订单号 用户id            -&gt;setMoney($money)  //商品价格            -&gt;setBody($body)  //商品名            -&gt;doPaid();

支付成功回调
1234567891011121 ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/ahuang_blog/2020/05/05/015/" title="微信小程序支付、退款、转账"><img class="post-bg" src="https://fastly.jsdelivr.net/gh/jerryc127/CDN@latest/cover/default_bg.png" onerror="this.onerror=null;this.src='/ahuang_blog/img/404.jpg'" alt="微信小程序支付、退款、转账"></a></div><div class="recent-post-info"><a class="article-title" href="/ahuang_blog/2020/05/05/015/" title="微信小程序支付、退款、转账">微信小程序支付、退款、转账</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2020-05-05T09:50:01.000Z" title="发表于 2020-05-05 17:50:01">2020-05-05</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/ahuang_blog/categories/PHP/">PHP</a></span></div><div class="content">配置参数
1234567891011//微信参数   &#x27;app_id&#x27; 		=&gt; &#x27;&#x27;,   &#x27;app_secret&#x27; 	=&gt; &#x27;&#x27;,   //支付参数   &#x27;mchid&#x27;			=&gt;	&#x27;&#x27;,   &#x27;key&#x27;			=&gt;	&#x27;&#x27;,   &#x27;notify_url&#x27;	=&gt;	&quot;/api/v1/wechatpay/notify_url&quot;,

下单支付生成签名 （调用支付业务类）
123(new \tool\Pay())-&gt;getWechatPaySign($openid,  $price, $order_no, &#x27;商品名&#x27;);


支付成功回调  （调用支付业务类）
123(new \tool\Pay())-&gt;getWechatPaySign($openid,  $price, $order_no, &#x27;商品名&#x27;);


退款 ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/ahuang_blog/2019/11/25/012/" title="第三方登录之微信登录"><img class="post-bg" src="https://fastly.jsdelivr.net/gh/jerryc127/CDN@latest/cover/default_bg.png" onerror="this.onerror=null;this.src='/ahuang_blog/img/404.jpg'" alt="第三方登录之微信登录"></a></div><div class="recent-post-info"><a class="article-title" href="/ahuang_blog/2019/11/25/012/" title="第三方登录之微信登录">第三方登录之微信登录</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2019-11-25T05:05:02.000Z" title="发表于 2019-11-25 13:05:02">2019-11-25</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/ahuang_blog/categories/PHP/">PHP</a></span></div><div class="content">参数配置
12345678&#x27;wx_login&#x27; =&gt; array(    	&#x27;app_id&#x27; 		=&gt; 	&#x27;&#x27;,    	&#x27;app_secret&#x27;	=&gt;	&#x27;&#x27;,    	//&#x27;return_url&#x27;	=&gt;	&quot;http://&quot;.$_SERVER[&#x27;HTTP_HOST&#x27;].&quot;/index.php/Home/Logins/return_wx_url&quot;,  ),

控制器方法
12345678910111213141516171819202122232425262728293031323334353637383940414243444546/** * 微信登录 */public function  wx_login()&#123;  	$return_url = I(&#x27;get.return_url&#x27;);  	session(&#x27;return_url&#x27;,$r ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/ahuang_blog/2019/11/25/011/" title="第三方登录之QQ登录"><img class="post-bg" src="https://fastly.jsdelivr.net/gh/jerryc127/CDN@latest/cover/default_bg.png" onerror="this.onerror=null;this.src='/ahuang_blog/img/404.jpg'" alt="第三方登录之QQ登录"></a></div><div class="recent-post-info"><a class="article-title" href="/ahuang_blog/2019/11/25/011/" title="第三方登录之QQ登录">第三方登录之QQ登录</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2019-11-25T04:34:33.000Z" title="发表于 2019-11-25 12:34:33">2019-11-25</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/ahuang_blog/categories/PHP/">PHP</a></span></div><div class="content">PC端第三方登录之QQ登陆
参数配置
1234567&#x27;qq_login&#x27; =&gt; [  	&#x27;app_id&#x27; 		=&gt; &#x27;1014321xxx&#x27;,  	&#x27;app_key&#x27; 		=&gt; &#x27;90d372138cd3f799cc945302ac0xxx&#x27;,  	&#x27;return_url&#x27; 	=&gt; &quot;http://xxx/index.php/Home/Logins/return_qq_url&quot;,  ],

控制器方法
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 /** * [qq_login 口口登录授权 * @return [type] [description] */public function qq_login()&#123;  	//http://xxx ...</div></div></div><div class="recent-post-item"><div class="post_cover left"><a href="/ahuang_blog/2019/09/28/018/" title="Tp5框架整合七牛云上传视频"><img class="post-bg" src="https://fastly.jsdelivr.net/gh/jerryc127/CDN@latest/cover/default_bg.png" onerror="this.onerror=null;this.src='/ahuang_blog/img/404.jpg'" alt="Tp5框架整合七牛云上传视频"></a></div><div class="recent-post-info"><a class="article-title" href="/ahuang_blog/2019/09/28/018/" title="Tp5框架整合七牛云上传视频">Tp5框架整合七牛云上传视频</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2019-09-28T10:55:49.000Z" title="发表于 2019-09-28 18:55:49">2019-09-28</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/ahuang_blog/categories/PHP/">PHP</a></span></div><div class="content">配置参数
123456789return [   &#x27;ACCESSKEY&#x27;  =&gt;  &#x27;&#x27;,       &#x27;SECRETKEY&#x27;  =&gt;  &#x27;&#x27;,       &#x27;BUCKET&#x27;     =&gt;   &#x27;&#x27;,			//空间名       &#x27;DOMAIN&#x27;     =&gt;   &#x27;&#x27;, //空间对外域名       &#x27;HUBNAME&#x27;    =&gt;    &#x27;&#x27;,         &#x27;qiniu_notify&#x27;=&gt;	, //转码成功后的验证的回调地址       &#x27;pipeline&#x27;  =&gt;  	&#x27;&#x27; //转码是使用的队列名称];
控制器操作
123456789101112131415161718192021222324252627282930313233343536373839404142/** * 获取七 ...</div></div></div><div class="recent-post-item"><div class="post_cover right"><a href="/ahuang_blog/2019/07/03/010/" title="Tp5整合生成条形码"><img class="post-bg" src="https://fastly.jsdelivr.net/gh/jerryc127/CDN@latest/cover/default_bg.png" onerror="this.onerror=null;this.src='/ahuang_blog/img/404.jpg'" alt="Tp5整合生成条形码"></a></div><div class="recent-post-info"><a class="article-title" href="/ahuang_blog/2019/07/03/010/" title="Tp5整合生成条形码">Tp5整合生成条形码</a><div class="article-meta-wrap"><span class="post-meta-date"><i class="far fa-calendar-alt"></i><span class="article-meta-label">发表于</span><time datetime="2019-07-03T11:48:05.000Z" title="发表于 2019-07-03 19:48:05">2019-07-03</time></span><span class="article-meta"><span class="article-meta-separator">|</span><i class="fas fa-inbox"></i><a class="article-meta__categories" href="/ahuang_blog/categories/PHP/">PHP</a></span></div><div class="content">BarcodeBakery库下载地址 (https://www.barcodebakery.com/en/download)
下载BarcodeBakery库放入vendor目录下
封装的类
123456789101112131415161718192021222324252627282930313233343536373839404142&lt;?phpnamespace tool;//头部引入use BarcodeBakery\Barcode\BCGcode128;use BarcodeBakery\Common\BCGColor;use BarcodeBakery\Common\BCGDrawing;use BarcodeBakery\Common\BCGFontFile;use think\facade\Env;class Barcode&#123;    public function barcode_create($number)    &#123;        require_once(Env::get(&#x27;vendor_path&#x27;).&#x27;ba ...</div></div></div><nav id="pagination"><div class="pagination"><a class="extend prev" rel="prev" href="/ahuang_blog/page/3/#content-inner"><i class="fas fa-chevron-left fa-fw"></i></a><a class="page-number" href="/ahuang_blog/">1</a><span class="space">&hellip;</span><a class="page-number" href="/ahuang_blog/page/3/#content-inner">3</a><span class="page-number current">4</span><a class="page-number" href="/ahuang_blog/page/5/#content-inner">5</a><a class="page-number" href="/ahuang_blog/page/6/#content-inner">6</a><a class="extend next" rel="next" href="/ahuang_blog/page/5/#content-inner"><i class="fas fa-chevron-right fa-fw"></i></a></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="/ahuang_blog/img/Misaka.jpg" onerror="this.onerror=null;this.src='/ahuang_blog/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">Ahuang</div><div class="author-info__description">Everything can be expected in the future</div></div><div class="card-info-data site-data is-center"><a href="/ahuang_blog/archives/"><div class="headline">文章</div><div class="length-num">51</div></a><a href="/ahuang_blog/tags/"><div class="headline">标签</div><div class="length-num">35</div></a><a href="/ahuang_blog/categories/"><div class="headline">分类</div><div class="length-num">8</div></a></div><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/changad" target="_blank" title="Github"><i class="fab fa-github"></i></a><a class="social-icon" href="mailto:136081905@qq.com" target="_blank" title="Email"><i class="fas fa-envelope"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>公告</span></div><div class="announcement_content">快乐每一天！！！</div></div><div class="sticky_layout"><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/ahuang_blog/2022/04/24/051/" title="项目中一些ThinkPhp的使用小技巧">项目中一些ThinkPhp的使用小技巧</a><time datetime="2022-04-24T10:43:22.000Z" title="发表于 2022-04-24 18:43:22">2022-04-24</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/ahuang_blog/2022/04/08/050/" title="Sql查询排名">Sql查询排名</a><time datetime="2022-04-08T08:24:16.000Z" title="发表于 2022-04-08 16:24:16">2022-04-08</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/ahuang_blog/2022/03/06/049/" title="ThinkPhp的跨域问题">ThinkPhp的跨域问题</a><time datetime="2022-03-06T04:40:38.000Z" title="发表于 2022-03-06 12:40:38">2022-03-06</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/ahuang_blog/2021/11/13/048/" title="Nginx关于Socket的配置">Nginx关于Socket的配置</a><time datetime="2021-11-13T07:02:15.000Z" title="发表于 2021-11-13 15:02:15">2021-11-13</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/ahuang_blog/2021/10/28/047/" title="Node.js之Express关于socket.io的使用">Node.js之Express关于socket.io的使用</a><time datetime="2021-10-28T04:36:17.000Z" title="发表于 2021-10-28 12:36:17">2021-10-28</time></div></div></div></div><div class="card-widget card-categories"><div class="item-headline">
            <i class="fas fa-folder-open"></i>
            <span>分类</span>
            
            </div>
            <ul class="card-category-list" id="aside-cat-list">
            <li class="card-category-list-item "><a class="card-category-list-link" href="/ahuang_blog/categories/PHP/"><span class="card-category-list-name">-PHP</span><span class="card-category-list-count">1</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/ahuang_blog/categories/Elasticsearch/"><span class="card-category-list-name">Elasticsearch</span><span class="card-category-list-count">4</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/ahuang_blog/categories/Linux/"><span class="card-category-list-name">Linux</span><span class="card-category-list-count">1</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/ahuang_blog/categories/MySQL/"><span class="card-category-list-name">MySQL</span><span class="card-category-list-count">5</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/ahuang_blog/categories/Node-js/"><span class="card-category-list-name">Node.js</span><span class="card-category-list-count">7</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/ahuang_blog/categories/PHP/"><span class="card-category-list-name">PHP</span><span class="card-category-list-count">30</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/ahuang_blog/categories/Redis/"><span class="card-category-list-name">Redis</span><span class="card-category-list-count">2</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/ahuang_blog/categories/jQuery/"><span class="card-category-list-name">jQuery</span><span class="card-category-list-count">1</span></a></li>
            </ul></div><div class="card-widget card-tags"><div class="item-headline"><i class="fas fa-tags"></i><span>标签</span></div><div class="card-tag-cloud"><a href="/ahuang_blog/tags/phpQrcode/" style="font-size: 1.15em; color: rgb(80, 195, 86)">phpQrcode</a><a href="/ahuang_blog/tags/Tp5/" style="font-size: 1.35em; color: rgb(50, 123, 180)">Tp5</a><a href="/ahuang_blog/tags/%E8%9E%8D%E4%BA%91%E8%81%8A%E5%A4%A9%E5%AE%A4/" style="font-size: 1.15em; color: rgb(42, 64, 180)">融云聊天室</a><a href="/ahuang_blog/tags/%E4%B8%83%E7%89%9B%E4%BA%91%E7%9B%B4%E6%92%AD/" style="font-size: 1.15em; color: rgb(177, 97, 81)">七牛云直播</a><a href="/ahuang_blog/tags/%E5%AE%B9%E8%81%94%E4%BA%91%E7%9F%AD%E4%BF%A1/" style="font-size: 1.15em; color: rgb(41, 190, 4)">容联云短信</a><a href="/ahuang_blog/tags/jQuery/" style="font-size: 1.15em; color: rgb(171, 179, 41)">jQuery</a><a href="/ahuang_blog/tags/Tp3/" style="font-size: 1.15em; color: rgb(95, 112, 81)">Tp3</a><a href="/ahuang_blog/tags/%E8%9E%8D%E4%BA%91%E8%81%8A%E5%A4%A9/" style="font-size: 1.15em; color: rgb(174, 124, 9)">融云聊天</a><a href="/ahuang_blog/tags/pdf/" style="font-size: 1.15em; color: rgb(60, 15, 91)">pdf</a><a href="/ahuang_blog/tags/Excel/" style="font-size: 1.15em; color: rgb(140, 183, 134)">Excel</a><a href="/ahuang_blog/tags/%E6%9D%A1%E5%BD%A2%E7%A0%81/" style="font-size: 1.15em; color: rgb(187, 42, 74)">条形码</a><a href="/ahuang_blog/tags/QQ%E7%99%BB%E5%BD%95/" style="font-size: 1.15em; color: rgb(10, 190, 8)">QQ登录</a><a href="/ahuang_blog/tags/%E5%BE%AE%E4%BF%A1%E7%99%BB%E5%BD%95/" style="font-size: 1.15em; color: rgb(124, 40, 131)">微信登录</a><a href="/ahuang_blog/tags/%E5%BE%AE%E4%BF%A1%E6%94%AF%E4%BB%98/" style="font-size: 1.25em; color: rgb(172, 110, 119)">微信支付</a><a href="/ahuang_blog/tags/%E6%94%AF%E4%BB%98%E5%AE%9D%E6%94%AF%E4%BB%98/" style="font-size: 1.2em; color: rgb(156, 167, 90)">支付宝支付</a><a href="/ahuang_blog/tags/Redis/" style="font-size: 1.2em; color: rgb(27, 138, 4)">Redis</a><a href="/ahuang_blog/tags/%E7%BC%93%E5%AD%98/" style="font-size: 1.2em; color: rgb(50, 185, 44)">缓存</a><a href="/ahuang_blog/tags/%E4%B8%83%E7%89%9B%E4%BA%91%E4%B8%8A%E4%BC%A0/" style="font-size: 1.15em; color: rgb(166, 92, 10)">七牛云上传</a><a href="/ahuang_blog/tags/%E5%8E%8B%E7%BC%A9/" style="font-size: 1.15em; color: rgb(173, 102, 149)">压缩</a><a href="/ahuang_blog/tags/%E4%B8%8B%E8%BD%BD/" style="font-size: 1.15em; color: rgb(142, 102, 25)">下载</a><a href="/ahuang_blog/tags/Yaconf/" style="font-size: 1.15em; color: rgb(150, 195, 106)">Yaconf</a><a href="/ahuang_blog/tags/Swoole/" style="font-size: 1.2em; color: rgb(174, 57, 151)">Swoole</a><a href="/ahuang_blog/tags/Nginx/" style="font-size: 1.2em; color: rgb(72, 157, 140)">Nginx</a><a href="/ahuang_blog/tags/%E5%9D%87%E8%A1%A1%E8%B4%9F%E8%BD%BD/" style="font-size: 1.15em; color: rgb(96, 58, 192)">均衡负载</a><a href="/ahuang_blog/tags/%E8%AE%BE%E8%AE%A1%E6%A8%A1%E5%BC%8F/" style="font-size: 1.3em; color: rgb(194, 145, 183)">设计模式</a><a href="/ahuang_blog/tags/MySQL/" style="font-size: 1.35em; color: rgb(144, 28, 193)">MySQL</a><a href="/ahuang_blog/tags/Linux/" style="font-size: 1.2em; color: rgb(70, 101, 67)">Linux</a><a href="/ahuang_blog/tags/Elasticsearch/" style="font-size: 1.3em; color: rgb(192, 191, 49)">Elasticsearch</a><a href="/ahuang_blog/tags/Node-js/" style="font-size: 1.45em; color: rgb(49, 75, 176)">Node.js</a><a href="/ahuang_blog/tags/Express/" style="font-size: 1.4em; color: rgb(103, 153, 108)">Express</a><a href="/ahuang_blog/tags/socket-io/" style="font-size: 1.15em; color: rgb(176, 78, 133)">socket.io</a><a href="/ahuang_blog/tags/ThinkPhp/" style="font-size: 1.25em; color: rgb(175, 64, 180)">ThinkPhp</a><a href="/ahuang_blog/tags/Socket/" style="font-size: 1.15em; color: rgb(53, 34, 62)">Socket</a><a href="/ahuang_blog/tags/%E9%82%AE%E4%BB%B6%E5%8F%91%E9%80%81/" style="font-size: 1.15em; color: rgb(69, 133, 177)">邮件发送</a><a href="/ahuang_blog/tags/PHPMailer/" style="font-size: 1.15em; color: rgb(37, 42, 108)">PHPMailer</a></div></div><div class="card-widget card-archives"><div class="item-headline"><i class="fas fa-archive"></i><span>归档</span><a class="card-more-btn" href="/ahuang_blog/archives/" title="查看更多">
    <i class="fas fa-angle-right"></i></a></div><ul class="card-archive-list"><li class="card-archive-list-item"><a class="card-archive-list-link" href="/ahuang_blog/archives/2022/04/"><span class="card-archive-list-date">四月 2022</span><span class="card-archive-list-count">2</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/ahuang_blog/archives/2022/03/"><span class="card-archive-list-date">三月 2022</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/ahuang_blog/archives/2021/11/"><span class="card-archive-list-date">十一月 2021</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/ahuang_blog/archives/2021/10/"><span class="card-archive-list-date">十月 2021</span><span class="card-archive-list-count">7</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/ahuang_blog/archives/2021/08/"><span class="card-archive-list-date">八月 2021</span><span class="card-archive-list-count">9</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/ahuang_blog/archives/2021/06/"><span class="card-archive-list-date">六月 2021</span><span class="card-archive-list-count">7</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/ahuang_blog/archives/2021/05/"><span class="card-archive-list-date">五月 2021</span><span class="card-archive-list-count">1</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/ahuang_blog/archives/2021/04/"><span class="card-archive-list-date">四月 2021</span><span class="card-archive-list-count">1</span></a></li></ul></div><div class="card-widget card-webinfo"><div class="item-headline"><i class="fas fa-chart-line"></i><span>网站资讯</span></div><div class="webinfo"><div class="webinfo-item"><div class="item-name">文章数目 :</div><div class="item-count">51</div></div><div class="webinfo-item"><div class="item-name">本站总字数 :</div><div class="item-count">46.3k</div></div><div class="webinfo-item"><div class="item-name">本站访客数 :</div><div class="item-count" id="busuanzi_value_site_uv"><i class="fa-solid fa-spinner fa-spin"></i></div></div><div class="webinfo-item"><div class="item-name">本站总访问量 :</div><div class="item-count" id="busuanzi_value_site_pv"><i class="fa-solid fa-spinner fa-spin"></i></div></div><div class="webinfo-item"><div class="item-name">最后更新时间 :</div><div class="item-count" id="last-push-date" data-lastPushDate="2023-02-21T07:20:11.237Z"><i class="fa-solid fa-spinner fa-spin"></i></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2018 - 2023 By Ahuang</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div><div class="footer_custom_text">Everything can be expected in the future!</div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button id="go-up" type="button" title="回到顶部"><span class="scroll-percent"></span><i class="fas fa-arrow-up"></i></button></div></div><div id="local-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">搜索</span><span id="loading-status"></span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="is-center" id="loading-database"><i class="fas fa-spinner fa-pulse"></i><span>  数据库加载中</span></div><div class="search-wrap"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div><hr/><div id="local-search-results"></div></div></div><div id="search-mask"></div></div><div><script src="/ahuang_blog/js/utils.js"></script><script src="/ahuang_blog/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox.umd.min.js"></script><script src="/ahuang_blog/js/search/local-search.js"></script><div class="js-pjax"></div><script src="https://cdn.bootcss.com/canvas-nest.js/1.0.0/canvas-nest.min.js"></script><script async src="https://cdn.jsdelivr.net/npm/js-heo@1.0.11/categoryBar/categoryBar.js"></script><script src="/blog/js/categoryBar.js"><script defer="defer" id="fluttering_ribbon" mobile="true" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/dist/canvas-fluttering-ribbon.min.js"></script><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/dist/activate-power-mode.min.js"></script><script>POWERMODE.colorful = true;
POWERMODE.shake = true;
POWERMODE.mobile = true;
document.body.addEventListener('input', POWERMODE);
</script><script id="click-heart" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/dist/click-heart.min.js" async="async" mobile="true"></script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div><!-- hexo injector body_end start --><script data-pjax>
  function butterfly_clock_injector_config(){
    var parent_div_git = document.getElementsByClassName('sticky_layout')[0];
    var item_html = '<div class="card-widget card-clock"><div class="card-glass"><div class="card-background"><div class="card-content"><div id="hexo_electric_clock"><img class="entered loading" id="card-clock-loading" src="/ahuang_blog/img/loading.gif" style="height: 120px; width: 100%;" data-ll-status="loading"/></div></div></div></div></div>';
    console.log('已挂载butterfly_clock')
    parent_div_git.insertAdjacentHTML("afterbegin",item_html)
    }
  var elist = 'null'.split(',');
  var cpage = location.pathname;
  var epage = 'all';
  var flag = 0;

  for (var i=0;i<elist.length;i++){
    if (cpage.includes(elist[i])){
      flag++;
    }
  }

  if ((epage ==='all')&&(flag == 0)){
    butterfly_clock_injector_config();
  }
  else if (epage === cpage){
    butterfly_clock_injector_config();
  }
  </script><script src="https://pv.sohu.com/cityjson?ie=utf-8"></script><script data-pjax src="https://npm.elemecdn.com/hexo-butterfly-clock/lib/clock.min.js"></script><!-- hexo injector body_end end --></body></html>